#ifndef _HTCalc_h_included_
#define _HTCalc_h_included_
#include <d3dx9.h>
#include <d3d9.h>
#include "DXUtil.h"

//this class is used to find the varius calculations needed for hypertexturing
class HTCalc
{
	static int* p;
	static int* permutation;

public:

	static float ObjectDensityFunc(D3DXVECTOR3 center, float radius, float softness, D3DXVECTOR3 point);
	static float Bias(float b, float t);
	static float Gain(float g, float t);
	static double Noise(D3DXVECTOR3 point, double freq);
	static float Turbulence(D3DXVECTOR3 &point, double minFreq, double maxFreq);
	static double ImprovedNoise(double x, double y, double z);
	static void Initialize();
	static double fade(double t);
	static double lerp(double t, double a, double b); 
	static double grad(int hash, double x, double y, double z);
	static void Unload();
};
#endif
